package com.ms.demo;

import com.ms.demo.Expression;

/**
 * @description: 定义终结符表达式
 * @author: ms
 * @create: 2022-10-28 11:18
 */
public class TerminalExpression implements Expression {

    private String data;

    public TerminalExpression(String data){
        this.data = data;
    }

    @Override
    public boolean interpret(String context) {
        if(context.contains(data)){
            return true;
        }
        return false;
    }
}